/**
 * ZHU framework. Copyright 2012-, all rights reserved.
 *
 * $Id: DailyLifecycle.java 26 2012-08-20 09:44:34Z zhuxiaopeng $
 * $Revision: 26 $
 * $Date: 2012-08-20 17:44:34 +0800 (一, 2012-08-20) $
 * $Author: zhuxiaopeng $
 */
package daily.entity;

import java.util.*;

import javax.persistence.*;

import zhu.framework.entity.lifecycle.*;

/**
 * <p>
 * </p>
 * 
 * @author $Author: zhuxiaopeng $
 * @version $Revision: 26 $ - $Date: 2012-08-20 17:44:34 +0800 (一, 2012-08-20) $
 */
public class FilesLifecycle extends AbstractLifecycle<Files> {

	public FilesLifecycle(final LifecycleContext lifecycleContext) {
		super(lifecycleContext);
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see zhu.framework.entity.lifecycle.Lifecycle#getEntityType()
	 */
	@Override
	public Class<Files> getEntityType() {
		return Files.class;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see zhu.framework.entity.lifecycle.Lifecycle#newInstance()
	 */
	@Override
	public Files newInstance() {
		return new Files();
	}

	public List<Files> findAll() {
		final StringBuilder buf = new StringBuilder();
		buf.append(" select o from Files o ");
		final Query query = getEntityManager().createQuery(buf.toString());
		return getQueryResultList(query);
	}
}
